﻿using SSDM.SqlCE.AdditionUI;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Windows;
using System;
using System.Diagnostics;
using SSCEViewer_UnitTest;

namespace SqlCeViewer_UnitTest
{


  /// <summary>
  ///This is a test class for ChangeSdfPwdTest and is intended
  ///to contain all ChangeSdfPwdTest Unit Tests
  ///</summary>
  [TestClass()]
  public class ChangeSdfPwdTest
  {


    private TestContext testContextInstance;

    /// <summary>
    ///Gets or sets the test context which provides
    ///information about and functionality for the current test run.
    ///</summary>
    public TestContext TestContext
    {
      get
      {
        return testContextInstance;
      }
      set
      {
        testContextInstance = value;
      }
    }

    #region Additional test attributes
    // 
    //You can use the following additional attributes as you write your tests:
    //
    //Use ClassInitialize to run code before running the first test in the class
    //[ClassInitialize()]
    //public static void MyClassInitialize(TestContext testContext)
    //{
    //}
    //
    //Use ClassCleanup to run code after all tests in a class have run
    //[ClassCleanup()]
    //public static void MyClassCleanup()
    //{
    //}
    //
    //Use TestInitialize to run code before running each test
    //[TestInitialize()]
    //public void MyTestInitialize()
    //{
    //}
    //
    //Use TestCleanup to run code after each test has run
    //[TestCleanup()]
    //public void MyTestCleanup()
    //{
    //}
    //
    #endregion


    /// <summary>
    ///A test for butChange_Click
    ///</summary>
    [TestMethod()]
    [DeploymentItem("SqlCeViewer.exe")]
    public void butChangeSSCEPwd_ClickTest()
    {

        testContextInstance.RecordTestMethod();

#pragma warning disable 0067
        PrivateObject param0 = null; // TODO: Initialize to an appropriate value
#pragma warning restore 0067

        Debug.WriteLine("I am not sure this value has effect" + param0);

      ChangeSdfPwd_Accessor target = new ChangeSdfPwd_Accessor("dfd"); // TODO: Initialize to an appropriate value
      object sender = null; // TODO: Initialize to an appropriate value
      RoutedEventArgs e = null; // TODO: Initialize to an appropriate value

      target.Db = "C:\\1.sdf";
      target.txtOldPwd.Password = "";
      target.txtNewConfirmPwd.Password = "";
      target.txtNewPwd1.Password = "";
      try
      {
        target.butChange_Click(sender, e);
        TestGlobalExtension.RecordTestMethod();


      }
      catch (InvalidOperationException se)
      {
        Debug.WriteLine(se.Message);
        TestGlobalExtension.RecordTestMethod();
      }
      catch (Exception ee)
      {
        Debug.WriteLine(ee.Message);
        TestGlobalExtension.RecordTestMethod();
      }
    }
  }
}
